package Client;

import Server.Domain.Message;
import Server.Domain.MessageType;
import Server.Domain.User;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;

public class Task extends Thread {
    Socket socket ;
    ObjectInputStream ois;
    Message message;
    Task(Socket socket)  {
        this.socket = socket;
    }
    @Override
    public void run() {
        while (true) {
            try {
                ois = new ObjectInputStream(socket.getInputStream());
                message = (Message) ois.readObject();

            } catch (IOException | ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
            System.out.println(message.getContent());
        }
    }
}
            //解析


